<%@ page import="com.ddz.model.LoginMessage" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2024/12/21
  Time: 11:54
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <link type="text/css" rel="stylesheet" href="./css/login.css">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>用户登录</title>
</head>
<body>
<%
    if(request.getAttribute("loginMessage")!=null){
        LoginMessage loginMessage = (LoginMessage)request.getAttribute("loginMessage");
        request.setAttribute("Msg",loginMessage.getMsg());
        request.setAttribute("return_json",loginMessage.getJsonObject());
    }
%>
<div class="login-container">
    <!-- 图片在上半部分 -->
    <div class="login-image"></div>

    <!-- 表单在下半部分 -->
    <div class="login-form">
        <h2>用户登录</h2>
        <%
            String msg = (String) request.getAttribute("Msg");
        %>
        <div id="msg" class="error-msg"><%= msg != null ? msg : "" %></div>
        <form action="./login" id="loginform" method="post">
            <label for="uid">账号：</label>
            <input type="text" name="uid" id="uid" value="${return_json.getString("userID")}" autocomplete="off">
            <label for="upwd">密码：</label>
            <input type="password" name="upwd" id="upwd" value="${return_json.getString("password")}">
            <button type="button" class="btn-img btn-login" id="loginBtn"></button>
            <button type="button" class="btn-img btn-register" id="regBtn"></button>
        </form>
    </div>
</div>

<script type="text/javascript" src="./js/jquery-3.7.1.min.js"></script>
<script type="text/javascript" src="./js/login.js"></script>
</body>
</html>